package com.yunhe.day322.dao;

import com.yunhe.day322.domain.Role;
import com.yunhe.day322.domain.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao {
    UserInfo findUserByUsername(String username);

    void save(UserInfo userInfo);
    // 查询所有用户
    List<UserInfo> findAllUsers();

    UserInfo findUserInfoById(Integer id);

    List<Role> findOtherRole(Integer id);

    UserInfo findUserById(Integer id);

    void addRoleToUser(@Param("userId") Integer userId, @Param("roleid") Integer roleid);

    void deleteUserRole(int id);

    void deleteById(int id);
}
